/*
 create by sys on 2016/11/22.
 */

define(["require",'config/appregister',"business/Companyinfor/service/htttp","business/services/filter","jquery","business/workSkill/directive/startLevel"],function(require,app,httpServices){
    app.controller('companyDetailsCtrl',function($scope,$timeout,$stateParams,$state,auth){
		auth.isCompanyLogin();
        if($stateParams.modeifyWorkId){
			$scope.saveJob=function(item){
				$state.go("companyDetailsCtrl",{modeifyWorkId:item.jobId})
			}
			$scope.myhome=function(){
                $state.go("comIndexCtrl")
			}
			$scope.companyout=function(item){
				$state.go("outIndexCtrl",{companyId:item.companyId})
			}
			function getDeatilsJob(){
				var req ={//默认全部内容
					type:"GET",
					uri:"get",
					data:{
						jobId:$stateParams.modeifyWorkId
					}
				};
				httpServices.getJobLangularOne(req).success(function(response){
					$scope.$apply(function(){
						
						var req ={//默认全部内容
							type:"GET",
							uri:"getSameJob",
							data:{
								jobId:response.data.jobId,
								count:6
							}
						};
						httpServices.getJobLangularOne(req).success(function(response){
							$scope.$apply(function(){
								$scope.similarJob = response.data;
							})
						});
						var req ={
							type:"GET",
							uri:"getCompanyJob",
							data:{
								jobId:response.data.jobId,
								count:6
							}
						};
						httpServices.getJobLangularOne(req).success(function(response){
							$scope.$apply(function(){

								$scope.otherJob = response.data;
							})
						});
					})
					$scope.job = response.data;
					$scope.jobWelfare = response.data.jobWelfare.split(',');
				});
				
			}
			getDeatilsJob();

        }

	
    })
});
